package com.example.buttomnavigationapplication.base;

import android.content.Context;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import butterknife.ButterKnife;

public abstract class BaseActivity  extends AppCompatActivity {
    private Context mcontext;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mcontext=this;
        //绑定布局
        setContentView(initLayoutResource());
        //绑定 butterKnife
        ButterKnife.bind(this);
        //数据初始化
        initData();
    }
    /**
     * 初始化数据
     */
    protected abstract void initData();

    /**
     * 显示布局
     * @return
     */
    protected abstract int initLayoutResource();
}
